package Top200;

/**
 * @author zhangmin
 * @create 2022-02-19 10:26
 */
public class removeElement27 {
    public int removeElement(int[] nums, int val) {
        int left=0,right=0;
        while (right<nums.length){
            if (nums[right]!=val){
                nums[left]=nums[right];
                left++;right++;
            }else {
                right++;
            }
        }
        return left;
    }
}
